<template>
    <div id="trunk">
		<vHead appPath="/prepare" appTitle="备课">
            <router-link v-if="isAdd" :to="{path: '/prepare/add',query: {type: type}}"><el-button type="primary">新建备课</el-button></router-link>
        </vHead>
        <main class="main">
            <router-view />
        </main>
        <vFoot></vFoot>
    </div>
</template>
<script>
import vHead from "@/components/common/header";
import vFoot from '@/components/common/footer';
export default {
    computed: {
        isAdd(){
           const showNames = ['personal','collective'];
           let routeName = this.$route.name;
            return showNames.includes(routeName);
        },
        type(){
           return this.$route.name === 'personal' ? 0 : 1;
        }
    },
    components: {
		vHead,
		vFoot
    }
};
</script>
<style lang="scss">
.main {
    box-sizing: border-box;
    min-height: calc(100vh - 124px);
    padding: 25px 0 40px;
}
.course-menunav a {
    display: block;
    line-height: 65px;
}
@import  './../../../assets/css/prepare.scss'
</style>